// pages/my/my.js
var httpUtil = require('../../utils/httpUtil.js');
var config = require('../../config.js');
var that;
var user;
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  getMoney: function () {
    httpUtil.req(config.requestUrl +"/workerController/getIndividualMember", {
      "workerId": user.workerId//user.workerCode
    }, function (res) {
      //res为返回的数据
      that.setData({
        money: res.object.noMentionNumber
      });
      console.log(res.object.noMentionNumber);
    })
  },
  loginOut:function(e){
    wx.setStorageSync("uid",2);
    wx.reLaunch({
      url: '../index/index',
    })
  },
  message: function () {
    wx.navigateTo({
      url: '/pages/message/message',
    })
  },
  collect: function () {
    wx.navigateTo({
      url: '/pages/collect/collect',
    })
  },
  index: function () {
    wx.navigateTo({
      url: '/pages/index/index',
    })
  },
  receiving: function () {
    wx.navigateTo({
      url: '/pages/receiving/receiving',
    })
  },
  tixian: function () {
    wx.navigateTo({
      url: '/pages/withdraw/withdraw',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    that = this;
    user = wx.getStorageSync("workerInfo");
    //that.getMoney();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let pages = getCurrentPages(); //页面栈
    let currPage = pages[pages.length - 1]; //当前页面
    that.getMoney();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})